/**
 * Created with JetBrains WebStorm.
 * User: Administrator
 * Date: 13-6-9
 * Time: 上午9:38
 * To change this template use File | Settings | File Templates.
 */

Ext.define('cloud.view.admin.AdminEdit', {
    extend: 'Ext.form.Panel',
    xtype: 'adminedit',
//    requires: ['Ext.form.Panel', 'Ext.field.Password',
//        'Ext.tab.Panel', 'Ext.form.FieldSet', 'Ext.field.Toggle', 'Ext.field.Select', 'Ext.ux.Fileup', 'Ext.Img', 'Ext.dataview.DataView'],
    config: {
        title: '更新管理员信息',
        layout: 'card',
        items: [
            {
                xtype: 'toolbar',
                docked: 'bottom',
                layout: {
                    type: 'hbox',
                    pack: 'end'
                },
                items: [
                    {
                        id: 'admin_edit',
                        iconMask: true,
                        scope: this,
                        text: '更新',
                        cls: 'x-button2',
                        style: 'float:right',
                        centered: true

                    }
                ]
            },
            {
                xtype: 'tabpanel',
                id: 'tabpanelEdit',
                cls: 'tabpanel-1',
                items: [
                    {
                        title: '修改管理员状态和角色',
                        style: 'padding-left:10px',
                        id: 'fieldset0',
                        items: {
                            xtype: 'fieldset',
                            defaults: {
                                labelwidth: '20%',
                                xtype: 'textfield'
                            },

                            items: [
                                {
                                    id: 'adminedit_camid',
                                    name: 'camid',
                                    label: 'ID',
                                    maxLength: 50,
                                    hidden: true
                                },
                                {  name:'carid',
                                    xtype: 'selectfield',
                                    store: 'RoleAllFind',
                                    id: 'adminEdit_carid',
                                    label: '请选择角色',
                                    displayField: 'name',
                                    valueField: 'id'

                                },

                                {   xtype: 'togglefield',
                                    id: 'adminedit_status',
                                    name: 'status',
                                    label: '状态',
                                    value: 1
                                }
                            ]

                        }
                    },
                    {
                        title: '修改管理员密码',
                        style: 'padding-left:10px',
                        id: 'fieldset1',
                        items: {
                            xtype: 'fieldset',

                            defaults: {
                                labelwidth: '20%',
                                xtype: 'textfield',
                                required: true,
                                clearIcon: true
                            },
                            items: [
//                                {
//                                    id: 'adminedit_camid_update',
//                                    name: 'camid',
//                                    label: 'ID',
//                                    maxLength: 50,
//                                    hidden: true
//                                },
                                {   xtype: 'passwordfield',
                                    id: 'adminedit_oldpassword',
                                    name: 'oldpassword',
                                    label: '旧密码',
                                    maxLength: 50,
                                    placeHolder: '请输入旧密码'
                                },
                                {   xtype: 'passwordfield',
                                    id: 'adminedit_password',
                                    name: 'password',
                                    label: '新密码',
                                    maxLength: 50,
                                    placeHolder: '请输入新密码'
                                }
                            ]
                        }
                    }
                ]
            }


        ]
    }
});